﻿<phone:PhoneApplicationPage 
    x:Class="SkyPoint.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:local="clr-namespace:SkyPoint"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True" Loaded="PhoneApplicationPage_Loaded">
    
    <phone:PhoneApplicationPage.Resources>
        <local:RadiusConverter x:Key="RadiusConverter"/>
        <local:SpectralTypeConverter x:Key="SpectralTypeConverter"/>
    </phone:PhoneApplicationPage.Resources>
    
    
    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="HELLO" Style="{StaticResource PhoneTextNormalStyle}" Foreground="#FFB22E2E" />
            <TextBlock x:Name="PageTitle" Text="hello world" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}" Foreground="#FFB22E2E" />
        </StackPanel>
        
        
        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Margin="12,139,12,0" Grid.RowSpan="2">
            <Button Content="Start" Height="105" HorizontalAlignment="Center" Margin="175,0" Name="startButton" VerticalAlignment="Top" Width="106" Click="startButton_Click" Foreground="#FFB22E2E" BorderBrush="#FFB22E2E" />
            <TextBlock Height="34" HorizontalAlignment="Left" Margin="20,6,0,0" Name="raLabel" Text="Right Ascension" VerticalAlignment="Top" />
            <TextBlock Height="34" HorizontalAlignment="Left" Margin="287,6,0,0" Name="declLabel" Text="Declination" VerticalAlignment="Top" />
            <TextBlock Height="63" HorizontalAlignment="Left" Margin="288,26,0,0" Name="declValue" Text="0.0" VerticalAlignment="Top" FontSize="40" Foreground="#FF4E6AAA" TextAlignment="Left" Width="148" />
            <TextBlock FontSize="40" Foreground="#FF4E6AAA" Height="63" HorizontalAlignment="Left" Margin="20,26,0,0" Name="raValue" Text="0.0" VerticalAlignment="Top" Width="141" TextAlignment="Right" />
            <ListBox Height="315" HorizontalAlignment="Left" Margin="20,124,0,0" Name="starBox" VerticalAlignment="Top" Width="416">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="64" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="64" />
                            </Grid.ColumnDefinitions>
                            <Ellipse 
                                Grid.Column="0" 
                                Width="{Binding Path=Magnitude,Converter={StaticResource RadiusConverter}}" 
                                Height="{Binding Path=Magnitude,Converter={StaticResource RadiusConverter}}" 
                                Fill="{Binding Path=ObjectColor,Converter={StaticResource SpectralTypeConverter}}">
                            </Ellipse>
                            <StackPanel Grid.Column="1">
                                <TextBlock Text="{Binding Path=Name}" FontWeight="Bold" FontSize="24" />
                                <TextBlock Text="{Binding Path=Designation}" FontSize="18" />
                            </StackPanel>
                        </Grid>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Grid>
    </Grid>
 
    <!--Sample code showing usage of ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->

</phone:PhoneApplicationPage>